import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '主页',
    redirect: '/home',
    component: () => import('../views/IndexView.vue'),
    children: [
      {
        path: '/home',
        name: '单词',
        component: () => import('../views/wordviews/WordHome.vue')
      },
      {
        path: '/class',
        name: '课堂',
        component: () => import('../views/classviews/ClassHome.vue')
      },
      {
        path: '/find',
        name: '发现',
        component: () => import('../views/findviews/FindHome.vue')
      },
      {
        path: '/store',
        name: '商城',
        component: () => import('../views/storeviews/StoreHome.vue')
      },
      {
        path: '/me',
        name: '我的',
        component: () => import('../views/meviews/MeHome.vue')
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
